<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<base th:href="@{/}"/>
<link rel="stylesheet" th:href="@{/css/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{/css/Managerstyle.css}"/>
<script th:src="@{/js/jquery-3.4.1.min.js}"></script>
<script th:src="@{/js/bootstrap.min.js}"></script>
</head>
<body>

	
	请输入班级id:
	<input type="text" id="bid" /> <br />
	请输入周次：
	<input type="text" id="cycle" />
	<button id="selectSchedule1" type="button">查询</button>
	
	
	<br />
	
	请输入教室id:
	<input type="text" id="bid" /> <br />
	请输入周次：
	<input type="text" id="cycle" />
	<button id="selectSchedule2" type="button">查询</button>
	

	<table id="display" class="table table-hover" >
		<tr>
			<th></th>
			<th>周一</th>
			<th>周二</th>
			<th>周三</th>
			<th>周四</th>
			<th>周五</th>
			<th>周六</th>
			<th>周七</th>
		</tr>
		<tr>
			<th>第1节</th>
			<td id="td1_1"></td>
			<td id="td2_1"></td>
			<td id="td3_1"></td>
			<td id="td4_1"></td>
			<td id="td5_1"></td>
			<td id="td6_1"></td>
			<td id="td7_1"></td>
		</tr>
		<tr>
			<th>第2节</th>
			<td id="td1_2"></td>
			<td id="td2_2"></td>
			<td id="td3_2"></td>
			<td id="td4_2"></td>
			<td id="td5_2"></td>
			<td id="td6_2"></td>
			<td id="td7_2"></td>
		</tr>
		<tr>
			<th>第3节</th>
			<td id="td1_3"></td>
			<td id="td2_3"></td>
			<td id="td3_3"></td>
			<td id="td4_3"></td>
			<td id="td5_3"></td>
			<td id="td6_3"></td>
			<td id="td7_3"></td>	
		</tr>
		<tr>
			<th>第4节</th>	
			<td id="td1_4"></td>
			<td id="td2_4"></td>
			<td id="td3_4"></td>
			<td id="td4_4"></td>
			<td id="td5_4"></td>
			<td id="td6_4"></td>
			<td id="td7_4"></td>
		</tr>
		<tr>
			<th>第5节</th>
			<td id="td1_5"></td>
			<td id="td2_5"></td>
			<td id="td3_5"></td>
			<td id="td4_5"></td>
			<td id="td5_5"></td>
			<td id="td6_5"></td>
			<td id="td7_5"></td>
		</tr>
		<tr>
			<th>第6节</th>
			<td id="td1_6"></td>
			<td id="td2_6"></td>
			<td id="td3_6"></td>
			<td id="td4_6"></td>
			<td id="td5_6"></td>
			<td id="td6_6"></td>
			<td id="td7_6"></td>
		</tr>
		<tr>
			<th>第7节</th>
			<td id="td1_7"></td>
			<td id="td2_7"></td>
			<td id="td3_7"></td>
			<td id="td4_7"></td>
			<td id="td5_7"></td>
			<td id="td6_7"></td>
			<td id="td7_7"></td>
		</tr>
		<tr>
			<th>第8节</th>
			<td id="td1_8"></td>
			<td id="td2_8"></td>
			<td id="td3_8"></td>
			<td id="td4_8"></td>
			<td id="td5_8"></td>
			<td id="td6_8"></td>
			<td id="td7_8"></td>
		</tr>
		<tr>
			<th>第9节</th>
			<td id="td1_9"></td>
			<td id="td2_9"></td>
			<td id="td3_9"></td>
			<td id="td4_9"></td>
			<td id="td5_9"></td>
			<td id="td6_9"></td>
			<td id="td7_9"></td>
		</tr>
		<tr>
			<th>第10节</th>
			<td id="td1_10"></td>
			<td id="td2_10"></td>
			<td id="td3_10"></td>
			<td id="td4_10"></td>
			<td id="td5_10"></td>
			<td id="td6_10"></td>
			<td id="td7_10"></td>
		</tr>
	</table>
	
	<script>
		$(document).ready(function(){
				
			$("#selectSchedule1").click(function(){
			 	$.ajax({
					url: 'mc/getScheduleByBidAndCycle',
					type: 'GET',
					data: {bid: $("#bid").val(),cycle: $("#cycle").val()},
					success: function(data){
						$("#display tr td").html("");
						$.each(data,function(index,value){
							var str1 = value.coursePlan.lessionPlan.course.cname + "<br />" +
							value.coursePlan.teacher.tname + "<br />" + 
							value.classroom.building.buildname + value.classroom.clrnum + "<br>" + 
							value.cycle ;
							$("#td"+value.sweek+"_"+value.strtime).html(str1);
						});
						
					},
					error: function(req,status,error){
						$("#display").empty();
					}
				}); 
				
			});
			
			/* $("#selectSchedule2").click(function(){
			 	$.ajax({
					url: 'mc/getScheduleByBid',
					type: 'GET',
					data: {bid: $("#bid").val(),cycle: $("#cycle").val()},
					success: function(data){
						$.each(data,function(index,value){
							var str1 = value.coursePlan.lessionPlan.course.cname + "<br />" +
							value.coursePlan.teacher.tname + "<br />" + 
							value.classroom.building.buildname + value.classroom.clrnum + "<br>" + 
							value.cycle ;
							$("#td"+value.sweek+"_"+value.strtime).html(str1);
						});
						
					},
					error: function(req,status,error){
						
					}
				}); 
				
			}); */
			
			
		});
	</script>

</body>
</html>